package common.controller.base;

import common.model.response.base.Result;

/**
 * controller公共父类
 *
 * @author 米泽鹏
 * @since 2021-07-09 上午 11:22
 */
public class BaseController {

	protected <T> Result<T> success() {
		return Result.success();
	}

	protected <T> Result<T> successWithMessage(String message) {
		return Result.successWithMessage(message);
	}

	protected <T> Result<T> successWithData(T data) {
		return Result.successWithData(data);
	}

	protected <T> Result<T> success(String message, T data) {
		return Result.success(message, data);
	}

	protected <T> Result<T> error() {
		return Result.error();
	}

	protected <T> Result<T> error(String message) {
		return Result.error(message);
	}

	protected <T> Result<T> error(Integer code, String message) {
		return Result.error(code, message);
	}

}
